#ifndef COMMAND_H
#define COMMAND_H

#include "Arduino.h"

#define COMMAND_SIZE 3

namespace CommandType
{
  typedef enum
  { 
    TRAIN_SPEED_MOVE_FORWARD_UPDATE,
    TRAIN_SPEED_MOVE_BACKWARD_UPDATE,
    TRAIN_SPEED_STOP_UPDATE, 
    TRAIN_SPEED_UPDATE_ACK,
    TRAIN_SMOKE_UPDATE, 
    SWITCHRAIL_POSITION_UPDATE,
    SWITCHRAIL_POSITION_UPDATE_ACK,
    LIGHT_STATE_UPDATE,
    SENSOR_DETECTION
  }commandTypes;
}

namespace CommandStatus
{
  typedef enum
  { 
    ACCEPTED,
    ADAPTED,
    DELAYED,
    REFUSED
  }commandStatus;
}
    
class Command {
  public:
    Command(byte type, byte deviceId, byte value);  // Constructor
    Command(); // Constructor
    /* Methodes */
    void serialize(byte* dataToTransmit);
    boolean addByte(byte newByte);
    byte getType();
    byte getDeviceId();
    byte getValue();
    
  private:
    /* Attribute */
    byte m_type;
    boolean m_typeIsSet;
    byte m_deviceId;
    boolean m_deviceIdIsSet;
    byte m_value;
    boolean m_valueIsSet;
};
#endif /* COMMAND_H */
